{% extends "base.html" %}
{% block content %}

    <div class="row">
        <div class="col-lg-8">
            <div class="panel panel-default">
                <div class="panel-heading">
                    云监工设置
                </div>
                <!-- /.panel-heading -->
                <div class="panel-body">
                    <!-- Nav tabs -->
                    <ul class="nav nav-tabs">
                        <li class="{% if action is none or action == 'setting' %} active{% endif %}"><a href="#setting" data-toggle="tab" aria-expanded="false">设置</a></li>
                        <li class="{% if action == 'info' %} active{% endif %}"><a href="#info" data-toggle="tab" aria-expanded="false">账户</a></li>
                        <li class="{% if action == 'profile' %} active{% endif %}"><a href="#profile" data-toggle="tab" aria-expanded="false">自动</a></li>
                        <li class="{% if action == 'password' %} active{% endif %}"><a href="#password" data-toggle="tab" aria-expanded="false">密码</a></li>
                    </ul>
                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div class="tab-pane fade {% if action is none or action == 'setting' %}active in{% endif %}" id="setting">
                            <br />
                            {% if err_msg and (action is none or action == 'setting') %}
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    {{ err_msg }}
                                </div>
                            {% endif %}
                            <form role="form" action="/user/change_property/auto_column/{% if user_info.auto_column  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-bar-chart-o"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_column %}目前是迅雷统计产量,可在监控中心查看{% else %}目前是默认统计产量,可在监控中心查看{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_column  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 140px;">默认产量统计</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success" style="text-align:left; width: 140px;">迅雷产量统计</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/is_show_speed_data/{% if user_info.is_show_speed_data  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                     <span class="input-group-addon"><i style="width: 16px;" class="fa fa-trello"></i>
                                                </span>
                                    <input class="form-control" value="{% if user_info.is_show_speed_data %}X -（已隐藏速度曲线）{% else %}O -（已显示速度曲线）{% endif %}" disabled>
                                    
                                        <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.is_show_speed_data  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 140px;">显示速度曲线</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success" style="text-align:left; width: 140px;">隐藏速度曲线</button>
                                        {% endif %}
                                        </span>
                                    
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/is_show_wpdc/{% if user_info.is_show_wpdc == 0 %}1{% elif user_info.is_show_wpdc == 1 %}2{% else %}0{% endif %}" method="post">
                                <div class="form-group input-group">
                                     <span class="input-group-addon"><i style="width: 16px;" class="fa fa-trello"></i>
                                                </span>
                                    <input class="form-control" value="{% if user_info.is_show_wpdc == 0 %}0 -（已显示今日宝箱转盘 ）{% elif user_info.is_show_wpdc == 1 %}1 -（已显示本周宝箱转盘 ）{% else %}2 -（已显示本月宝箱转盘）{% endif %}" disabled>
                                    
                                        <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.is_show_wpdc==0 %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 140px;">显示本周宝箱</button>
                                        {% elif user_info.is_show_wpdc==1 %}
                                            <button type="submit" class="btn btn-warning" style="text-align:left; width: 140px;">显示本月宝箱</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success" style="text-align:left; width: 140px;">显示今日宝箱</button>
                                        {% endif %}
                                        </span>
                                    
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/is_show_byname/{% if user_info.is_show_byname  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                     <span class="input-group-addon"><i style="width: 16px;" class="fa fa-trello"></i>
                                                </span>
                                    <input class="form-control" value="{% if user_info.is_show_byname %}X -（当前显示账户名）{% else %}O - （当前隐藏账户名，显示别名）{% endif %}" disabled>
                                    
                                        <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.is_show_byname  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 140px;">隐藏账户名</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success" style="text-align:left; width: 140px;">显示账户名</button>
                                        {% endif %}
                                        </span>
                                    
                                </div>
                            </form>
                            
                            <form role="form" action="/user/change_property/draw_money_modify/1" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-dashcube"></i></span>
                                    <input class="form-control" name="draw_money_modify" value="{{ user_info.draw_money_modify }}" placeholder="提现金额修正值(单位：元)" type='text'>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        <button type="submit" class="btn btn-info" style="text-align:left; width: 140px;">设置提现下限(元)</button>
                                    </span>
                                </div>
                            </form>
                            <form role="form" action="/user/change_property/collect_crystal_modify/1" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-dashcube"></i></span>
                                    <input class="form-control" name="collect_crystal_modify" value="{{user_info.collect_crystal_modify|safe}}" placeholder="自动收取水晶修正值(单位：个)" type='text'>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        <button type="submit" class="btn btn-info" style="text-align:left; width: 140px;">设置收取下限(个)</button>
                                    </span>
                                </div>
                            </form>
                        </div>
                        <div class="tab-pane fade{% if action == 'info' %} active in{% endif %}" id="info">
                            <br />
                            {% if err_msg and (action is none or action == 'info') %}
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    {{ err_msg }}
                                </div>
                            {% endif %}
                            <div class="form-group input-group ">
                                <span class="input-group-addon"><span style="width: 16px; display: inline-block;">U</span></span>
                                <input type="text" class="form-control" placeholder="" value="{{ user_info.username }}" disabled>
                            </div>

                            <div class="form-group input-group">
                                <span class="input-group-addon"><i style="width: 16px;" class="fa fa-check"></i></span>
                                <input type="text" class="form-control" value="{% if user_info.active %}O{% else %}X{% endif %}" disabled>
                                <span class="input-group-addon"><span style="text-align:left; width: 90px; display: inline-block;">状态</span></span>
                            </div>

                            <div class="form-group input-group">
                                <span class="input-group-addon"><i style="width: 16px;" class="fa fa-wrench"></i></span>
                                <input type="text" class="form-control" value="{% if user_info.is_admin %}O{% else %}X{% endif %}" disabled>
                                <span class="input-group-addon"><span style="text-align:left; width: 90px; display: inline-block;">管理员</span></span>
                            </div>

                            <div class="form-group input-group">
                                <span class="input-group-addon"><i style="width: 16px;" class="fa fa-group"></i></span>
                                <input type="text" class="form-control" value="{{ user_info.max_account_no|default('2') }}" disabled>
                                <span class="input-group-addon"><span style="text-align:left; width: 90px; display: inline-block;">迅雷账号限制</span></span>
                            </div>

                            <form role="form" action="/user/change_info" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><span style="width: 16px; display: inline-block;">@</span></span>
                                    <input type="email" class="form-control" name="email" value="{{ user_info.email }}" placeholder="crystal@xunlei.com">
                                </div>
                                <button type="submit" class="btn btn-default">提交</button>
                                <button type="reset" class="btn btn-default">重置</button>
                            </form>

                        </div>

                        <div class="tab-pane fade{% if action == 'profile' %} active in{% endif %}" id="profile">
                            <br />
                            {% if err_msg and (action == 'profile') %}
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    {{ err_msg }}
                                </div>
                            {% endif %}
                            <form role="form" action="/user/change_property/auto_collect/{% if user_info.auto_collect %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_collect  %}已开启默认高于{{ user_info.collect_crystal_modify }}水晶自动收取，每{{ system.collect_crystal_interval // 60 }}分钟检测一次{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_collect  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消收取水晶</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">收取水晶</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/auto_drawcash/{% if user_info.auto_drawcash  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_drawcash %}已开启默认高于{{ user_info.draw_money_modify }}自动全额提现，每周二12点至17点间每{{ system.drawcash_crystal_interval // 60 }}分钟检测一次{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_drawcash  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消自动提现</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">自动提现</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/auto_giftbox/{% if user_info.auto_giftbox  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_giftbox %}已开启自动开免费宝箱、丢弃收费宝箱，每{{ system.giftbox_crystal_interval// 60 }}分钟检测一次{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_giftbox  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消免费宝箱</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">免费宝箱</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/auto_searcht/{% if user_info.auto_searcht  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_searcht %}已开启自动秘银进攻，每{{ system.searcht_crystal_interval // 60 }}分钟检测一次{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_searcht  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消秘银进攻</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">秘银进攻</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/auto_revenge/{% if user_info.auto_revenge  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_revenge %}已开启自动秘银复仇，每{{ system.revenge_crystal_interval // 60 }}分钟检测一次{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_revenge  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消秘银复仇</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">秘银复仇</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>

                            <form role="form" action="/user/change_property/auto_getaward/{% if user_info.auto_getaward  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_getaward %}已开启自动幸运转盘，每{{ system.getaward_crystal_interval // 60 }}分钟检测一次，每天仅转前三次{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_getaward  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消幸运转盘</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">幸运转盘</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>
                            <form role="form" action="/user/change_property/auto_detect/{% if user_info.auto_detect  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_detect %}已开启自动监测矿机状态，每{{ system.auto_detect_interval // 60 }}分钟检测一次{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_detect  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消自动监测</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">自动监测</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>
                            <form role="form" action="/user/change_property/auto_report/{% if user_info.auto_report  %}0{% else %}1{% endif %}" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon"><i style="width: 16px;" class="fa fa-rmb"></i></span>
                                    <input type="text" class="form-control" value="{% if user_info.auto_report %}已开启自动报告矿机收益，每天凌晨报告收益状况{% else %}X{% endif %}" disabled>
                                    <span class="input-group-btn" style="padding-top: 0px;padding-bottom: 0px;">
                                        {% if user_info.auto_report  %}
                                            <button type="submit" class="btn btn-danger" style="text-align:left; width: 117px;">取消自动报告</button>
                                        {% else %}
                                            <button type="submit" class="btn btn-success">自动报告</button>
                                        {% endif %}
                                    </span>
                                </div>
                            </form>

                        </div>

                        <div class="tab-pane fade{% if action == 'password' %} active in{% endif %}" id="password">
                            <br />
                            {% if err_msg and action == 'password' %}
                                <div class="alert alert-danger alert-dismissable">
                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                    {{ err_msg }}
                                </div>
                            {% endif %}
                            <form role="form" action="/user/change_password" method="post">
                                <div class="form-group input-group">
                                    <span class="input-group-addon">UN</span>
                                    <input type="text" class="form-control" placeholder="" value="{{ user_info.username }}" disabled>
                                </div>
                                <div class="form-group input-group">
                                    <span class="input-group-addon">OP</span>
                                    <input type="password" class="form-control" name="old_password" placeholder="请输入老密码">
                                </div>
                                <div class="form-group input-group">
                                    <span class="input-group-addon">NP</i></span>
                                    <input type="password" class="form-control" name="new_password" placeholder="输入新密码">
                                    <input type="password" class="form-control" name="new2_password" placeholder="再次输入新密码">
                                </div>

                                <button type="submit" class="btn btn-default">提交</button>
                                <button type="reset" class="btn btn-default">重置</button>
                            </form>
                        </div>
                    </div>
                </div>
                <!-- /.panel-body -->
            </div>
        </div>
        <!-- /.col-lg-12 -->
    </div>
{% endblock %}

{% block navibar %}
    <div class="col-lg-10">
        <h2>我的账户管理</h2>
        <ol class="breadcrumb">
            <li>
                <a href="/">Home</a>
            </li>
            <li class="active">
                <strong>Profile</strong>
            </li>
        </ol>
    </div>
{% endblock %}
{% set active_page = "profile" %}
